#include <stdio.h>
#include <string.h>
 
int main()
{
    FILE *file = fopen("X:\\h1.txt","w");
    if(file == NULL)
    {
        printf("open error!\n");
        return 0;
    }
    char name[] = "hello world!";
    int i;
    for(i = 0; i < strlen(name); i++)
    {
        fputc(name[i], file);
    }
    fputc('\n', file);
    fclose(file);
    return 0;
}